package cn.sskxyz.security.authorization.web.args;

import java.util.Collections;
import java.util.Set;
import java.util.stream.Collectors;

public class ClientInfoArgs {
    private String clientId;
    private String clientSecret;
    private Set<String> scope = Collections.emptySet();
    private String redirectUri;
    private Set<String> authorities = Collections.emptySet();
    private String extraInfo="";
    private Set<String> grantTypes = Collections.emptySet();

    public String getClientId() {
        return clientId;
    }

    public void setClientId(String clientId) {
        this.clientId = clientId;
    }

    public String getClientSecret() {
        return clientSecret;
    }

    public void setClientSecret(String clientSecret) {
        this.clientSecret = clientSecret;
    }

    public String getScope() {
        return scope.stream().collect(Collectors.joining(","));
    }

    public void setScope(Set<String> scope) {
        this.scope = scope;
    }

    public String getRedirectUri() {
        return redirectUri;
    }

    public void setRedirectUri(String redirectUri) {
        this.redirectUri = redirectUri;
    }

    public String getAuthorities() {
        return authorities.stream().collect(Collectors.joining(","));
    }

    public void setAuthorities(Set<String> authorities) {
        this.authorities = authorities;
    }

    public String getExtraInfo() {
        return extraInfo;
    }

    public void setExtraInfo(String extraInfo) {
        this.extraInfo = extraInfo;
    }

    public String getGrantTypes() {
        return grantTypes.stream().collect(Collectors.joining(","));
    }

    public void setGrantTypes(Set<String> grantTypes) {
        this.grantTypes = grantTypes;
    }
}
